package com.system.login.controller;

import com.system.login.model.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;

@Controller
public class playController {

    private Map<String, User> map = new HashMap<>();

    @PostConstruct
    public void init() {
        User user = new User();
        user.setPwd("123");
        user.setUsername("还有书");
        map.put("a", user);
        user = new User();
        user.setPwd("132");
        user.setUsername("caonima");
        map.put("b", user);
    }


    @RequestMapping("/get")
    public String user(ModelMap modelMap) {

        //User user=map.get("b");
        modelMap.addAttribute("users", "还有谁");
        return "index";


    }


}
